
import { createRouter, createWebHashHistory } from 'vue-router'
import routes from './route'

const router = createRouter({
  // 指定路由模式
  history: createWebHashHistory(),
  // 路由地址
  routes,
  scrollBehavior(to, from, savedPosition) {
    if (savedPosition) {
      return savedPosition
    } else {
      return { top: 0 }
    }
  }
})

export default router
